<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <button>点击获得数据</button>
    <script src="jquery-1.12.4.js"></script>
    <script>
        $(()=>{
            $('button').on('click',function () {
               $.post(
                   'http://127.0.0.1:8080',
                   (e)=>{
                      res=JSON.parse(e);
                       console.log(res);
                        for(let i =0;i<res.length;i++){
                            $('body').append(res[i].name+'<br>')
                        }
                   }
               )
            })
        })
    </script>
</body>
</html>
